

def accuracy_score(y_predict, y_test):
    """
    计算准确率
    :param y_predict:
    :param y_test:
    :return:
    """
    assert y_test.shape[0] == y_predict.shape[0], \
        "the size of y_true must be equal to the size of y_predict"
    return sum(y_predict == y_test) / len(y_test)